package com.jmb.api.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.util.Date;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;

import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Size;
import lombok.Data;

/**
 * @author jinbo 2025 9.25
 * @TableName t_db
 */
@TableName(value ="t_db")
@Data
public class Db extends BaseEntity {

    /**
     * 名称
     */
    @Schema(description = "名称")
    @NotEmpty(message = "名称不能为空")
    @Size(min = 1, max = 20, message = "名称长度必须为[1,20]")
    @TableField(value = "name")
    private String name;

    /**
     * 0mysql 1oracle 2SqlServer
     */
    @Schema(description = "数据库类型 0:mysql 1:oracle 2:Server")
    @NotNull(message = "数据库类型不能为空")
    @TableField(value = "type")
    private Integer type;

    /**
     * 描述
     */
    @Schema(description = "描述")
    @TableField(value = "description")
    private String description;

    /**
     * 连接url
     */
    @Schema(description = "连接url")
    @NotEmpty(message = "URL不能为空")
    @Size(min = 1, max = 200, message = "URL长度必须为[1,200]")
    @TableField(value = "url")
    private String url;

    /**
     * 用户名
     */
    @Schema(description = "用户名")
    @NotEmpty(message = "帐号不能为空")
    @Size(min = 1, max = 100, message = "帐号长度必须为[1,100]")
    @TableField(value = "username")
    private String username;

    /**
     * 密码
     */
    @Schema(description = "密码")
    @NotEmpty(message = "密码不能为空")
    @Size(min = 1, max = 100, message = "密码长度必须为[1,100]")
    @TableField(value = "password")
    private String password;


    /**
     * 0启动 1禁用
     */
    @NotNull(message = "状态不能为空")
    @TableField(value = "status")
    private Integer status;

    /**
     * 测试环境url
     */
    @Schema(description = "测试环境url")
    @NotEmpty(message = "测试环境URL不能为空")
    @Size(min = 1, max = 200, message = "测试环境URL长度必须为[1,200]")
    @TableField(value = "test_url")
    private String testUrl;

    /**
     * 测试环境username
     */
    @Schema(description = "测试环境账号")
    @NotEmpty(message = "测试环境帐号不能为空")
    @Size(min = 1, max = 100, message = "测试环境帐号长度必须为[1,100]")
    @TableField(value = "test_username")
    private String testUsername;

    /**
     * 测试环境password
     */
    @Schema(description = "测试环境密码")
    @NotEmpty(message = "测试环境密码不能为空")
    @Size(min = 1, max = 100, message = "测试环境密码长度必须为[1,100]")
    @TableField(value = "test_password")
    private String testPassWord;

    /**
     * 开发环境url
     */
    @Schema(description = "开发环境url")
    @NotEmpty(message = "开发环境URL不能为空")
    @Size(min = 1, max = 200, message = "开发环境URL长度必须为[1,200]")
    @TableField(value = "dev_url")
    private String devUrl;

    /**
     * 开发环境username
     */
    @Schema(description = "开发环境账号")
    @NotEmpty(message = "开发环境帐号不能为空")
    @Size(min = 1, max = 100, message = "开发环境帐号长度必须为[1,100]")
    @TableField(value = "dev_username")
    private String devUsername;

    /**
     * 开发环境password
     */
    @Schema(description = "开发环境密码")
    @NotEmpty(message = "开发环境密码不能为空")
    @Size(min = 1, max = 100, message = "开发环境密码长度必须为[1,100]")
    @TableField(value = "dev_password")
    private String devPassword;

    /**
     * 预上线环境url
     */
    @Schema(description = "预上线环境url")
    @NotEmpty(message = "预上线环境URL不能为空")
    @Size(min = 1, max = 200, message = "预上线环境URL长度必须为[1,200]")
    @TableField(value = "stg_url")
    private String stgUrl;

    /**
     * 预上线环境username
     */
    @Schema(description = "预上线环境账号")
    @NotEmpty(message = "预上线环境帐号不能为空")
    @Size(min = 1, max = 100, message = "预上线环境帐号长度必须为[1,100]")
    @TableField(value = "stg_username")
    private String stgUsername;

    /**
     * 预上线环境password
     */
    @Schema(description = "预上线环境密码")
    @NotEmpty(message = "预上线环境密码不能为空")
    @Size(min = 1, max = 100, message = "预上线环境密码长度必须为[1,100]")
    @TableField(value = "stg_password")
    private String stgPassword;

    /**
     * 生产环境url
     */
    @Schema(description = "生产环境url")
    @NotEmpty(message = "生产环境URL不能为空")
    @Size(min = 1, max = 200, message = "生产环境URL长度必须为[1,200]")
    @TableField(value = "prod_url")
    private String prodUrl;

    /**
     * 生产环境username
     */
    @Schema(description = "生产环境账号")
    @NotEmpty(message = "生产环境帐号不能为空")
    @Size(min = 1, max = 100, message = "生产环境帐号长度必须为[1,100]")
    @TableField(value = "prod_username")
    private String prodUsername;

    /**
     * 生产环境password
     */
    @Schema(description = "生产环境密码")
    @NotEmpty(message = "生产环境密码不能为空")
    @Size(min = 1, max = 100, message = "生产环境密码长度必须为[1,100]")
    @TableField(value = "prod_password")
    private String prodPassword;
}